<%@page import="java.util.List"%>
<%@page import="qingke.bean.CartOfProduct"%>
<%@page import="qingke.mybatis.pojo.User"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!--头部-->
<link href="${pageContext.request.contextPath }/css/index.css"
	type="text/css" rel="stylesheet" />
<script src="${pageContext.request.contextPath }/js/jquery-1.8.3.min.js"></script>
<script src="${pageContext.request.contextPath }/js/top.js"></script>
<script src="${pageContext.request.contextPath }/js/cart.js"></script>
<%
	Object obj = session.getAttribute("user");
	User user = null;
	if (obj != null) {
		if (obj instanceof User) {
			user = (User) obj;
		}
	}
%>
<%
	Object chooseObejct = session.getAttribute("choose");
	String choose = null;
	if (chooseObejct != null) {
		if (chooseObejct instanceof String) {
			choose = (String) chooseObejct;
		}
	}
%>

<div class="t-yan"></div>
<div class="barder">
	<div class="barder-l">
		<a href="#"><img src="image/loge.jpg" /></a>
	</div>
	<div class="barder-c">
		<ul>
			<%
				String URL = request.getRequestURL().toString();
				int index = URL.lastIndexOf("/");
				StringBuffer sb = new StringBuffer("/bishe/");
				sb.append(URL.substring(index + 1, URL.length()));
			%>
			<li class="barder-c-ul-li"><a href="/bishe"
				<%if ("/bishe/index.jsp".equals(sb.toString())) {%> class="bootm"
				<%}%>>首页</a></li>
			<li class="barder-c-ul-li"><a href="Store/getAllStore"
				<%if ("/bishe/store.jsp".equals(sb.toString())) {%> class="bootm"
				<%}%>>店铺</a></li>
			<li class="barder-c-ul-li"><a href="Product/getAllProduct"
				<%if ("/bishe/product.jsp".equals(sb.toString())) {%> class="bootm"
				<%}%>>商品</a></li>
		</ul>
		<div></div>
	</div>
	<div class="barder-r">
		<div id="topcart">
			<!-- 目的是在登录页面不是显示当前用户是谁 -->
			<%
				if (!request.getRequestURL().toString().endsWith("login.jsp")) {
			%>
			<%
				if (user != null) {
			%>
			欢迎<%=user.getName()%>! <a href="personalcenter.jsp?message=cart">
				购物车 </a>
			<%
				}
			%>
			<%
				}
			%>
		</div>
		<br />
		<p>
			<a href="/bishe">首页</a>丨<a href="javascript:void(0);"
				disabled="disabled"
				onclick="join_favorite('轻客','http://localhost:8080/bishe')">收藏此页</a>丨
			<%
				if (user == null) {
			%>
			<a href="login.jsp" type="login">登录 </a>
			<%
				} else {
			%>
			<a href="logout" type="login">退出 </a>
			<%
				}
			%>
			|<a href="regist.jsp">注册</a>丨 <a <%if (user != null) {%>
				href="personalcenter.jsp" <%} else {%> href="login.jsp" <%}%>>个人中心</a>
		</p>
		<div class="for">
			<form action="select">
				<input type="text" id="sousuo" name="selectname"
					onblur="changesession()"
					<%if (request.getParameter("select") != null) {%>
					value=<%=request.getParameter("select")%> <%}%>></input> <select
					id="choose" name="choose">
					<option value="0" <%if ("0".equals(choose)) {%> selected="selected"
						<%}%>>店铺搜索</option>
					<option value="1" <%if ("1".equals(choose)) {%> selected="selected"
						<%}%>>商品搜索</option>
				</select> <input type="image" src="image/suosou.jpg" />
			</form>
		</div>
	</div>
</div>
